package org.example.classtopia.Config;

import org.example.classtopia.InterCeptor.AuthHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//注册拦截器到Springboot中
@Configuration
public class AuthWebMvcConfigurer implements WebMvcConfigurer {
    @Autowired
    private AuthHandlerInterceptor authHandlerInterceptor;

    /*@Override
    public void addInterceptors(InterceptorRegistry interceptorRegistry){
        interceptorRegistry.addInterceptor(authHandlerInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/loginByPassword")
                .excludePathPatterns("/loginByCode");         // 图标;
    }//放行Swagger文档的请求*/
    //真正使用要删掉这段注释，这里注释掉是因为开了这个Swagger3文档会被拦截
}
